
	//左侧菜单
	function showSecUl(obj){
		var $this=$(obj);
		var vis= $this.siblings("ul.homepage_secUl").css("display");
		if(vis=="none"){//展开
			$this.parent().addClass("on");
			$this.siblings("ul").slideDown();
			if($(".zhy_mall_btn_biga").length!=0){
			    var h =$(window).height()-155;
			}else{
				var h =$(window).height()-92;
			}
			$('.homepage_firstUl').slimScroll({scrollBy: "1px" });

			if($this.offset().top>=h){
				var scrollD= $this.siblings("ul").find("li").length*40+'px';
			    $('.homepage_firstUl').slimScroll( {scrollBy: "40px" });
			}
		}else{
			$this.parent().removeClass("on");
			$this.parent().find("ul").slideUp();
			$('.homepage_firstUl').slimScroll({scrollBy: "1px" });
		}
		return false;	
	}
	
	function showPrev(){
	
		var li_wid=parseInt($(".homepage_menu_bottom ul li").width())+10;
		var lft =parseInt($("#carousel ul").css("left"));
		var len=$(".homepage_menu_bottom ul li").length;
		var num = parseInt($("#carousel").width()/li_wid);
		if(lft<=-(li_wid*(len-num))){
	//	console.log(num)
			return;
		}else{
			$("#carousel ul").css({
				left:lft-li_wid
			})
		}
	}
	function showNext(){
		var li_wid=parseInt($(".homepage_menu_bottom ul li").width())+10;
		var lft =parseInt($("#carousel ul").css("left"));
		if(lft>=0){
			return;
		}else{
			$("#carousel ul").css({
				left:lft+li_wid
			})
		}
		
	}
	
function carouseWid(){
	var len=$(".homepage_menu_bottom ul li").length;
	var li_wid=$(".homepage_menu_bottom ul li").width()+10;
	var carousel_wid = len*li_wid;
	if($(window).width()-500<= carousel_wid){
		$("#carousel_button").show();
		var len=$(".homepage_menu_bottom ul li").length;
		var li_wid=$(".homepage_menu_bottom ul li").width()+10;
		var num = parseInt(($(window).width()-500)/li_wid);
		$("#carousel").css({
			width:li_wid*num+"px",
			overflow:'hidden',
			position:"relative"
		})
		$(".homepage_menu_main ul").css({
			width:len*li_wid+10+"px",
			position:"absolute",
			left:"0px"
		});
	}else{
		$("#carousel_button").hide();
		$("#carousel").css({
			width:"auto"
		})
		$(".homepage_menu_main ul").css({
			width:"auto",
			position:"static"
		});
	}
}
carouseWid()
$(window).resize(function(){
	carouseWid()
})

	$(function(){
		    var left_menu_height= $("#mainFrame").height()-10;
            $('.left_menu  ul.homepage_firstUl').slimScroll({// 左侧滚动条自适应
			   width: '180px',
		       height: left_menu_height, 
			   size: '5px',           
			   position: 'right',
			   color: '#e5e5e5',
			   alwaysVisible: false, 
			   railVisible: true, 
			   wheelStep: 10, 
			   allowPageScroll: false,
			   disableFadeOut: false 
			});
	})
	//左侧二级菜单
	$(".homepage_secUl li").live("click",function(){
		$(".homepage_secUl li").removeClass("on")
		$(this).addClass("on");
	})
	
	$(".homepage_menu_top > ul.test >li,.homepage_setBlank > ul >li,.homepage_webname").hover(function(){
		$(".ul_down").hide();
		if($(this).children(".ul_down").length!=0){
			$(this).find(".ul_down").show();
		}
	},function(){
		$(".ul_down").hide();
	})
	$(".ul_down a").click(function(e){
		window.event? window.event.cancelBubble = true : e.stopPropagation();
		$(this).parent().hide();
	})